<%-- 
    Document   : doctorupdate
    Created on : Jun 5, 2012, 8:16:44 PM
    Author     : sai
--%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <title>doctor update</title>        
        <link href="calendar.css" rel="stylesheet" type="text/css" />
        <link href="validate.css" rel="stylesheet" type="text/css" />
        <script src="calendar.js" ></script>
        <script src="validate.js"></script>        
    </head>
    <body>
<%@page import="java.sql.*,java.io.*,sai.mysql.DriverLoading" %>
            <%!                
                Statement state,state1;
                ResultSet result,result1;
                int deptid,exp;
                String userid;
                String url,url1;
                String did, uid, doc_name, email, address, mobile,qual,dept;
            %>
    
        <center><br><font size="7">Doctor Updation Form</font>
        <form name="dupdate" id="dupdate" method="post" action="./doctorupdate">
        <table border="0">            
            <%
                try {
                    DriverLoading dl = new DriverLoading();
                    state=dl.getStatement();
                    userid = request.getParameter("username");                    
                    url = "select DOCTOR_ID,USERID,dept_id,DOCTOR_NAME,EMAIL,ADDRESS,MOBILE,experience,MAX_QUALIFICATION from `doctor` where userid='" + userid + "'";                    
                    result = state.executeQuery(url);
                    boolean b = result.next();
                    if (b) {
                        did = result.getString(1);
                        uid = result.getString(2);
                        deptid = result.getInt(3);  
                        doc_name=result.getString(4);
                        email = result.getString(5);
                        address = result.getString(6);
                        mobile = result.getString(7);
                        exp=result.getInt(8);
                        qual=result.getString(9);
                    }      
                    else{
                        RequestDispatcher rd = request.getRequestDispatcher("doctorupdateerror.html");
                        rd.forward(request, response);
                    }


                } catch (SQLException e) {
                    out.println("Sql exception raised: . ." + e);
                } catch (Exception e) {
                    out.println("Exception raised  . . " + e);
                }
            %>
            <tr>
            <td><input  type="hidden" name="doctorid" id="doctorid" value="<%=did%>" /></td>
            </tr>
            
            <tr> 
                <td> <font size="4"><b><font color="red">*</font>Doctor name </b></font> </td> 
                <td><input  type="text" name="dname" id="dname" value="<%=doc_name%>" /></td></tr>
            
            <tr> <td> </td><td> </td>
                <td rowspan="5"><img src="" height="130" width="120"></tr>		
                        
            <tr> 
                <td> <font size="4"><b><font color="red">*</font>Gender </b></font> </td> </tr>
            <tr>
                <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                    <strong><input type="radio" name="gender" value="male" checked/>male</strong></td>
                <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <strong><input type="radio" name="gender" value="female"/>female</strong></td>
            </tr>               		
                    
            <tr> 
                <td> <font size="4"><b><font color="red">*</font>username </b></font> </td> 
                <td><input  type="text" name="username" id="username" value="<%=uid%> "/></td></tr>
            <tr> <td> </td><td> </td></tr>
                    
            <tr> 
                <td> <font size="4"><b><font color="red">*</font>Password</b></font></td> 
                <td><input  type="password" name="password" id="password"/></td></tr>
            <tr> <td> </td><td> </td></tr>
                    
            <tr> 
                <td> <font size="4"><b><font color="red">*</font>Re-enter Password </b></font> </td> 
                <td><input  type="password" name="repassword" id="repassword"/></td></tr>
            <tr> <td> </td><td> </td></tr>
                    
            <tr>
                <td> <font size="4"><b><font color="red">*</font>Address</b></font></td>
                <td><textarea rows=5 cols=15 name="address" id="address" ><%=address%> </textarea></td>
            </tr>         
                    
            <tr> 
                <td> <font size="4"><b><font color="red">*</font>EmailId </b></font> </td> 
                <td><input  type="text" name="email" id="email" maxlength="50" value="<%=email%>" /></td></tr>
            <tr> <td> </td><td> </td></tr>
                    
            <tr> 
                <td> <font size="4"><b><font color="red">*</font>Contact no . </b></font> </td> 
                <td><input  type="text" name="mobile" id="mobile" maxlength="10" value="<%=mobile%>" /></td></tr>
            <tr> <td> </td><td> </td></tr>              
                    
          
                    <tr>
                        <td><font color="red">*</font><b>Departments:</b></td>
                        <td>
                            <select name="dept" id="dept">
                                <option value="heart">heart</option>
                                <option value="neurology">neurology</option>
                                <option value="hematology">hematology</option>
                                <option value="orthopedics">orthopedics</option>
                                <option value="gasterology">gasterology</option>
                                <option value="urology">urology</option>
                                <option value="nephrology">nephrology</option>
                                <option value="endocrinology">endocrinology</option>
                                <option value="gynacology">gynacology</option>

                            </select>
                        </td>
                    </tr>	
            <tr> <td> <font color="red">*</font><font size="4"><b>experience</b></font> </td> 
                <td><input  type="text" name="experience" id="experience" value="<%=exp%>"/></td></tr>
            <tr> <td> </td><td> </td></tr>
                    
            <tr><td> <font color="red">*</font><font size="4"><b>Max Qualification</b></font> </td>
                <td><input type="text" name="qual" id="qual" value="<%=qual%>"/></td>
            </tr>
                    
            <tr>
                <td><font size="4"><b>Image </b></font></td>
                <td><input type="file" name="image" style="width:2px"/></td>
            </tr>
            <tr>
                <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
                <td><input type="submit" name="update" value="update" style="width:100px;margin-top:50px"/></td>
            </tr>			
                    
        </table>
    </form>
            
</center>
</html> 